<template>
  <div>
    <div class="buy-view">
      <div class="main-container">
        <el-tabs v-model="activeTabPane">
          <el-tab-pane :label="$t('tab.buy_btc')" name="btc">
            <div class="buy-box">
              <div class="detail">
                <p>購買單價: NT$215,468.643720 帳戶餘額: 0.00000000 BTC</p>
              </div>
              <el-form label-position="top" :model="buyBTC">
                <el-row>
                  <el-col :span="11">
                    <el-form-item label="購買比特幣">
                      <el-input v-model="buyBTC.num" placeholder="0.00"><i slot="suffix">BTC</i></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="2" class="tc">
                    <el-form-item label="-">
                      <i class="el-icon-d-caret" style="transform:rotate(90deg); font-size: 20px;"></i>
                    </el-form-item>
                  </el-col>
                  <el-col :span="11">
                    <el-form-item label="用新台幣支付">
                      <el-input v-model="buyBTC.value" placeholder="0"><i slot="suffix">USD</i></el-input>
                    </el-form-item>
                    </el-col>
                </el-row>
                <el-form-item label="請選擇付款方式">
                  <el-radio-group v-model="buyBTC.payType">
                    <el-radio label="銀行轉帳"></el-radio>
                    <el-radio label="萊爾富便利商店"></el-radio>
                  </el-radio-group>
                </el-form-item>
                <el-form-item size="large">
                  <el-button type="primary">购买比特币</el-button>
                </el-form-item>
              </el-form>
            </div>
          </el-tab-pane>
          <el-tab-pane :label="$t('tab.buy_eth')" name="eth">
            <div class="buy-box">
              <div class="detail">
                <p>購買單價: NT$13,359.720000  帳戶餘額: 0.00000000 ETH</p>
              </div>
              <el-form label-position="top" :model="buyBTC">
                <el-row>
                  <el-col :span="11">
                    <el-form-item label="購買以太币">
                      <el-input v-model="buyBTC.num" placeholder="0.00"><i slot="suffix">BTC</i></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="2" class="tc">
                    <el-form-item label="-">
                      <i class="el-icon-d-caret" style="transform:rotate(90deg); font-size: 20px;"></i>
                    </el-form-item>
                  </el-col>
                  <el-col :span="11">
                    <el-form-item label="用新台幣支付">
                      <el-input v-model="buyBTC.value" placeholder="0"><i slot="suffix">USD</i></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-form-item label="請選擇付款方式">
                  <el-radio-group v-model="buyBTC.payType">
                    <el-radio label="銀行轉帳"></el-radio>
                    <el-radio label="萊爾富便利商店"></el-radio>
                  </el-radio-group>
                </el-form-item>
                <el-form-item size="large">
                  <el-button type="primary">购买以太币</el-button>
                </el-form-item>
              </el-form>
            </div>
          </el-tab-pane>
          <el-tab-pane :label="$t('tab.buy_ltc')" name="ltc">
            <div class="buy-box">
              <div class="detail">
                <p>購買單價: NT$3,601.760000  帳戶餘額: 0.00000000 LTC</p>
              </div>
              <el-form label-position="top" :model="buyBTC">
                <el-row>
                  <el-col :span="11">
                    <el-form-item label="購買萊特幣">
                      <el-input v-model="buyBTC.num" placeholder="0.00"><i slot="suffix">BTC</i></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="2" class="tc">
                    <el-form-item label="-">
                      <i class="el-icon-d-caret" style="transform:rotate(90deg); font-size: 20px;"></i>
                    </el-form-item>
                  </el-col>
                  <el-col :span="11">
                    <el-form-item label="用新台幣支付">
                      <el-input v-model="buyBTC.value" placeholder="0"><i slot="suffix">USD</i></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-form-item label="請選擇付款方式">
                  <el-radio-group v-model="buyBTC.payType">
                    <el-radio label="銀行轉帳"></el-radio>
                    <el-radio label="萊爾富便利商店"></el-radio>
                  </el-radio-group>
                </el-form-item>
                <el-form-item size="large">
                  <el-button type="primary">购买萊特幣</el-button>
                </el-form-item>
              </el-form>
            </div>
          </el-tab-pane>
        </el-tabs>
        <div class="faq">
          <h4>常見問題</h4>
          <ul class="notes-list">
            <li>如何購買比特幣、以太幣或萊特幣？</li>
            <li>如果交易金額超過 $30,000 新台幣，該如何透過 ATM 支付？</li>
            <li>有哪些支付方法可以購買比特幣？</li>
            <li>購買比特幣多久後會收到？</li>
            <li>是否所有的銀行都支援？</li>
            <li>為何我無法購買？</li>
            <li>有哪些現行支付方法可以購買數位資產？</li>
            <li>如何購買比特幣與以太幣？</li>
            <li>身份驗證項目</li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  data () {
    return {
      activeTabPane: this.$route.params.coin ? this.$route.params.coin : 'btc',
      buyBTC: {
        num: '',
        value: '',
        payType: ''
      }
    }
  },
  computed: {
    ...mapState({
      path: state => state.route.path
    })
  },
  methods: {
  },
  watch: {
    path () {
      this.activeTabPane = this.$route.params.coin ? this.$route.params.coin : 'btc'
    }
  },
  created () {
  }
}
</script>

<style lang="less">
  .buy-view{
    .notes-list{
      padding-left: 15px;
      li{
        list-style: disc;
        font-size: 12px;
        line-height: 135%;
        color: #666;
        padding-bottom: 5px;
      }
    }
    .faq{
      margin: 30px 0;
      border-top: 1px dashed #ccc;
      padding-top: 30px;
      h4{
        margin-bottom: 10px;
        font-size: 14px;
        font-weight: 400;
      }
    }
    .buy-box{
      .detail{
        padding: 30px 0;
        border-bottom: 1px dashed #ccc;
        font-size: 14px;
      }
    }
  }
</style>
